﻿using System;
using Unity;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace AutoRule
{
    class CRegRuleManager : Singleton<CRegRuleManager>
    {
        

        public void Parse()
        {
            List<CRegRule> l = CDB.GetInstance().ParseRegMainRule();
            mutex.WaitOne();
            _list = l;
            mutex.ReleaseMutex();
        }

        public List<CRegRule> Get()
        {
            mutex.WaitOne();
            List<CRegRule> l = _list;
            mutex.ReleaseMutex();
            return l;
        }

   



        private List<CRegRule> _list;
        Mutex mutex = new Mutex();
    }
}
